package com.significantfiles.snapshot.engine.util;

import java.io.IOException;
import java.io.OutputStream;

public class Utils {

	public static final void closeStream(final OutputStream out) {
		if (out == null)
			throw new NullPointerException("parameter:out");
		
		try {
			out.close();
		} catch (final IOException e) {
			;
		}
	}

	public static boolean isGetterName(final String methodName) {
		final char charAfterGet = methodName.charAt(3);
		
		final boolean isUpperCase = Character.isUpperCase( charAfterGet );
		
		if( !isUpperCase ) return false;
		
		final boolean startsWithGet = methodName.startsWith( "get" );
		
		if( !startsWithGet ) return false;
		
		return true;
	}
}
